#include "pkgdb.h"
#include "dict.h"
#include "list.h"

pkgdb_p pkgdb_new() {
	list_p pkgdb = list_new();
	return (pkgdb_p)pkgdb;
}

void pkgdb_add(pkgdb_p pkgdb, pkg_p pkg) {
	list_add((list_p)pkgdb, (void *)pkg);
}

pkg_p pkgdb_get(pkgdb_p pkgdb) {
	return (pkg_p)list_get((list_p)pkgdb);
}

pkg_p pkgdb_remove(pkgdb_p pkgdb) {
	return (pkg_p)node_free(list_remove((list_p)pkgdb));
}

